<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function addText(){
				let element=document.createElement("div");//创建标签为div
				element.innerHTML="文本内容";
				document.querySelector(".con").appendChild(element);
			}
			function addImg(){
				let element=document.createElement("img");
				element.setAttribute("src","../src/ok.png");
				document.querySelector(".con").appendChild(element);
			}
		</script>
	</head>
	<body>
		
		<button type="button" onclick="addText()">添加文本</button>
		<button type="button" onclick="addImg()">添加图片</button>
		
		<div class="con">
			
		</div>
	</body>
</html>
